This invention relates to a method of encoding data by a data processor, and in particular to a method of efficiently processing and encoding 8-bit data into 5-bit data segments.
When information is processed by a data processing device, it is often necessary or convenient to store the data in an encoded form such as 5-bits per character. However, all commonly available data processors are designed to preferably handle data in 8-bit byte units. Therefore, what is desired is an efficient method of encoding 8-bit data into 5-bit data on a data processor handling data in 8-bit byte units.
It is also desirable that this method work on data which is input or output serially, that is, the bits are in sequential order, and the entire string of data is not immediately available for input or output. An example of this type of operation is where 8-bit data is to be encoded into 5-bit data and output via a serial data line to an output device, such as a printer.
While the encoding or conversion process can be accomplished by a bit-serial approach which reads and process one bit at a time, what is preferable is to have a "chunk" encoding process which processes and encodes several bits or bytes at a time, and therefore requires fewer operations by the data processor. This makes it a more desirable method for slower processors as well as suitable for real time applications in which data is arriving and being encoded at the same time.